<%-- 
    Document   : formularioModificarPersona
    Created on : 09/12/2010, 03:49:55 AM
    Author     : Daniel Ciuffi
--%>
<%@ include file='../Templates/security.jsp' %>
<script type="text/javascript">
    $(function(){
        $('#fechaNac').datepicker({
            dateFormat: 'dd/mm/yy',
            maxDate: new Date(),
            showOn: "button",
            buttonImage: "style/images/calendar.gif",
            buttonText: "calendario"
        }).attr('readonly', true);
        listaSedes();
        listaGrupos();
        listaHorarios();
    });
</script>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">

<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html" %>
<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic"%>

<h1 class="title">Gestión de Empleados</h1>

<p class="meta"></p>
<center>
    <h2>Modificar Empleado</h2>
    <html:form action="/ModificarPersona"
               styleId="modificarPersonaForm"
               onsubmit="return sendForm('modificarPersonaForm','ModificarPersona','center');" >
        <br>
        <table  align="center" border="0">
            <tr>
                <td>Cédula:</td>
                <td>
                    <html:select styleId="micombo1" property="voe" disabled="true">
                        <html:option value="V">V</html:option>
                        <html:option value="E">E</html:option>
                    </html:select>
                    &nbsp;-&nbsp;
                    <html:text size="17" maxlength="12" property="ci" disabled="true"/>
                </td>
                <td><font color="red">*&nbsp;</font></td>
                <td><p>(Sólo debe contener números)&nbsp;&nbsp;Ej. 15123432</p></td>
            </tr>
            <tr>
                <td></td>
                <td>
                    <html:errors property = "falta_Cedula"/>
                    <html:errors property = "invalid_Cedula"/>
                </td>
            </tr>

            <tr>
                <td>UsbId:</td>
                <td>
                    <html:text size="25" maxlength="35" property="usbid"/>
                </td>
                <td><font color="red">*&nbsp;</font></td>
                <td><p>Ej.&nbsp;pperez</p></td>
            </tr>
            <tr>
                <td></td>
                <td>
                    <html:errors property = "falta_UsbId"/>
                    <html:errors property = "invalid_UsbId"/>
                </td>
            </tr>
            <tr>
                <td>Primer Nombre:</td>
                <td>
                    <html:text size="25" maxlength="20" property="nombre1"/>
                </td>
                <td><font color="red">*&nbsp;</font></td>
                <td><p>(Sólo debe contener letras)&nbsp;&nbsp;Ej. Perdro</p></td>
            </tr>
            <tr>
                <td></td>
                <td>
                    <html:errors property = "falta_Nombre"/>
                    <html:errors property = "long_Nombre"/>
                    <html:errors property = "invalid_caracter_N1"/>
                </td>
            </tr>
            <tr>
                <td>Segundo Nombre:</td>
                <td>
                    <html:text size="25" maxlength="20" property="nombre2"/>
                </td>
                <td></td>
                <td><p>(Sólo debe contener letras)&nbsp;&nbsp;Ej. José</p></td>
            </tr>
            <tr>
                <td></td>
                <td>
                    <html:errors property = "invalid_caracter_N2"/>
                </td>
            </tr>
            <tr>
                <td>Primer Apellido:</td>
                <td>
                    <html:text size="25" maxlength="20" property="apellido1"/>
                </td>
                <td><font color="red">*&nbsp;</font></td>
                <td><p>(Sólo debe contener letras)&nbsp;&nbsp;Ej. Pérez</p></td>
            </tr>
            <tr>
                <td></td>
                <td>
                    <html:errors property = "falta_Apellido"/>
                    <html:errors property = "long_Apellido"/>
                    <html:errors property = "invalid_caracter_A1"/>
                </td>
            </tr>
            <tr>
                <td>Segundo Apellido:</td>
                <td>
                    <html:text size="25" maxlength="20" property="apellido2"/>
                </td>
                <td></td>
                <td><p>(Sólo debe contener letras)&nbsp;&nbsp;Ej. Jiménez</p></td>
            </tr>
            <tr>
                <td></td>
                <td>
                    <html:errors property = "invalid_caracter_A2"/>
                </td>
            </tr>

            <tr>
                <td >Sexo:</td>
                <td>
                    <html:select styleId="micombo2" property="sexo">
                        <html:option value="m">M</html:option>
                        <html:option value="f">F</html:option>
                    </html:select>
                </td>
            </tr>
            <tr>
                <td >Estado Civil:</td>
                <td>
                    <html:select styleId="micombo3" property="edoCivil">
                        <html:option value="Soltero">Soltero(a)</html:option>
                        <html:option value="Casado">Casado(a)</html:option>
                        <html:option value="Viudo">Viudo(a)</html:option>
                        <html:option value="Divorciado">Divorciado(a)</html:option>
                        <html:option value="Concubinato">Concubinato(a)</html:option>
                    </html:select>
                </td>
            </tr>
            <tr>
                <td>Fecha de Nacimiento:</td>
                <td>
                    <html:text size="25" maxlength="20" property="fechaNac" styleId="fechaNac"/>
                </td>
                <td><font color="red">*&nbsp;</font></td>
                <td><p>Formatp dd/mm/aaaa&nbsp;Ej.&nbsp;01/12/1988</p></td>
            </tr>
            <tr>
                <td></td>
                <td>
                    <html:errors property = "faltaFecha"/>
                    <html:errors property = "invalid_fechaNac"/>
                </td>
            </tr>
            <tr>
                <td>Teléfono:</td>
                <td>
                    <html:text size="25" maxlength="11" property="telefono"/>
                </td>
                <td></td>
                <td><p>Ej.&nbsp;02125555555</p></td>
            </tr>

            <tr>
                <td>Email (opcional):</td>
                <td>
                    <html:text size="25" maxlength="30" property="email"/>
                </td>
                <td><font color="red">*&nbsp;</font></td>
                <td><p>Ej.&nbsp;Pperez@gmail.com</p></td>
            </tr>
            <tr>
                <td></td>
                <td>
                    <html:errors property = "invalid_Email"/>
                </td>
            </tr>
            <tr>
                <td></td>
                <td>
                    <html:hidden property="profesion" value="Empleado"/>
                </td>
            </tr>
            <tr>
                <td></td>
                <td>
                    <html:hidden property="activo" value="si"/>
                </td>
            </tr>
            <tr>
                <td>Sede:</td>
                <td>
                    <select id="Sedes" name ="sede"></select>
                </td>
            </tr>
            <tr>
                <td>Tipo:</td>
                <td>
                    <html:select styleId="micombo4" property="tipoPersonal">
                        <html:option value="Fijo">Fijo</html:option>
                        <html:option value="Suplente">Suplente</html:option>
                        <html:option value="Contratado">Contratado</html:option>
                    </html:select>
                </td>
            </tr>
            <tr>
                <td>Horario:</td>
                <td>
                    <select id="Horarios" name ="idHorario"></select>
                </td>
            </tr>
            <tr>
                <td >Función del Empleado:</td>
                <td>
                    <select id="FUNCIONES" name ="funcion">
                        <script type="text/javascript">
                            $.getJSON("listaDeFuncion.do",
                            function(data) {
                                $.each(data.Funciones, function(i,item){
                                    var string = "<option value='"+item.id_funcion+"'>"+item.id_funcion+"</option>";
                                    $('#FUNCIONES').append(string)
                                });
                            });
                        </script>
                    </select>
                </td>
            </tr>
            <tr>
                <td>Grupo;</td>
                <td>
                    <select id="Grupos" name ="idGrupo"></select>
                </td>
            </tr>
            <tr>
                <td></td>
                <td>
                    <html:errors property = "grupo_no_existe"/>
                </td>
            </tr>

            <html:hidden styleId="micombo6" property="transporte" value="no"/>

            <%/*
                        <tr>
                        <td>Transporte;</td>
                        <td>
                        <html:select styleId="micombo6" property="transporte">
                        <html:option value="si">Si</html:option>
                        <html:option value="no">No</html:option>
                        </html:select>
                        </td>
                        </tr> */%>

            <tr>
                <td>Login:</td>
                <td>
                    <html:text size="25" maxlength="20" property="login"/>
                </td>
                <td><font color="red">*&nbsp;</font></td>
                <td><p>Ej.&nbsp;Pperez</p></td>
            </tr>

            <tr>
                <td></td>
                <td>
                    <html:errors property = "falta_login"/>
                    <html:errors property = "invalid_login"/>
                    <html:errors property = "login_ya_Existe"/>
                </td>
            </tr>

            <tr>
                <td>Permisos Sobre el Sistema</td>
                <td>
                    <select id="PERMISOS" name ="nombreRol">
                        <script type="text/javascript">
                            $.getJSON("listaRoles.do",
                            function(data) {
                                $.each(data.Roles, function(i,item){
                                    var string = "<option value='"+item.nombre+"'>"+item.nombre+"</option>";
                                    $('#PERMISOS').append(string)
                                });
                            });
                        </script>
                    </select>
                </td>
            </tr>

            <tr>
                <td></td>
                <td>
                    <html:errors property = "rol_no_existe"/>
                </td>
            </tr>
        </table>

        <br>
        <font color="red"><p>NOTA: Los campos que tiene * son obligatorios.</p></font>
        <br>

    </html:form>
    <button value="Modificar" onclick="return sendForm('modificarPersonaForm','ModificarPersona','center');">Modificar</button>
    <button value="Atrás" onclick="javascript: empleadosC()">Atrás</button>
    <br/>
    <CENTER><html:errors property = "persona_agregada"/></CENTER>
    <CENTER><html:errors property = "persona_No_agregada"/></CENTER>
    <CENTER><html:errors property = "persona_ya_Existe"/></CENTER>

</center>
<div style="clear: both;">&nbsp;</div>
